﻿Nier.name                   = "Nier"
Nier.hasIcon                = "Interface\\Icons\\Ability_Mount_NightmareHorse"
Nier.defaultMinimapPosition = 260 
Nier.defaultPosition        = "LEFT"
Nier.hideWithoutStandby     = true
Nier.OnMenuRequest          = Nier.options
Nier.clickableTooltip       = true
Nier.textDisplay            = nil

function Nier:OnTextUpdate()
	local text = ""
	if self.textDisplay and #self.textDisplay > 0 then
		text = self.textDisplay
	end
	for name, module in self:IterateModules() do
		if module and module.textDisplay and #module.textDisplay > 0 then
			text = text.." "..module.textDisplay
		end
	end
	self:SetText(text)
end

local tablet = AceLibrary("Tablet-2.0")

function Nier:OnTooltipUpdate()
	local cat
	for name, module in self:IterateModules() do
		if module and module.toolTip then
			cat = tablet:AddCategory(
				"columns", 1,
				"child_arg1", module
			)
			for k, v in pairs(module.toolTip) do
				if type(v) == "table" then
					cat:AddLine(v)
				end
			end
		end
	end
end
